<?php
class AppController extends Controller {

	var $components = array('Authake.Authake'); 
	var $helpers = array('Authake.Authak3', 'Html', 'Form', 'Javascript', 'Time', 'Text');
	
	function beforeFilter() {
		parent::beforeFilter(); 
		Configure::write('Config.language', 'no');
		// Set default cakelayout in admin
		if(isset($this->params['prefix']) and $this->params['prefix'] == 'admin') {
			$this->layout = "admin";
		}
		
		// No login on localhost
		if (env('REMOTE_ADDR') != '::1') {
		$this->Authake->beforeFilter($this);
		}
		//$this->Authake->beforeFilter($this);
		
		App::import("Model", "Settings.Setting");
    	$setting = new Setting;
		$setting->writeSettings();
	
		return true;
	}
	
	function afterFilter() {
		parent::afterFilter();
		
		// Build global menu
		//$this['menu'] = array('home'=>'nada');
	}

}
?>